//
//  darkview.swift
//  约健
//
//  Created by tyh on 2017/9/14.
//  Copyright © 2017年 tyh. All rights reserved.
//

import UIKit

protocol darkviewDelegate {
    
}

class darkview: UIView {
    
    var darkView:UIView!
    var Go:UIButton!
    
    override init(frame: CGRect) {
        super .init(frame: frame)
        self.LoadDarkView()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }


   private func LoadDarkView(){
        
        darkView = UIView()
        
        darkView.frame = CGRect(x: 0,y: 0,width: self.frame.size.width,height: self.frame.size.height)
        
        darkView.backgroundColor = UIColor(red: 0 / 255.0, green: 0 / 255.0, blue: 0 / 255.0, alpha: 0.7) // 设置半透明颜色
        
        
        self.addSubview(darkView)
        
        Go = UIButton.init(frame: CGRect(x: (self.frame.size.width * 2)/5, y: (self.frame.size.height * 5)/7, width: self.frame.size.width/5, height: self.frame.size.height/14))
        Go.setTitle("立即体验", for: .normal)
        Go.setTitleColor(UIColor.white, for: .normal)
        Go.backgroundColor = UIColor(displayP3Red: 0, green: 0, blue: 0, alpha: 0)
        Go.layer.borderWidth = 1
        Go.layer.borderColor = UIColor.white.cgColor
        Go.layer.cornerRadius = 10
        
        self.addSubview(Go)

    }
    /*
    func handleSingleTapGesture() {
        
        darkView.removeFromSuperview() // 点击移除半透明的View
        
    }*/
 
}
